package com.example.jetpack.data;

import android.view.View;
import com.example.jetpack.databinding.MainFragmentBinding;
import com.example.jetpack.ui.main.MainViewModel;
import com.squareup.picasso.Picasso;

public class MainPresenter {
    private MainViewModel viewModel ;
    private MainFragmentBinding binding;
    public MainPresenter( MainViewModel viewModel ,MainFragmentBinding binding ){
        this.viewModel = viewModel ;
        this.binding = binding;
    }

    public void load(){
        System.out.println("load");
        viewModel.setUser();

        Picasso.get().load(viewModel.getUser().getImageUrl()).resize(200,200)
                .into(binding.imageView);
    }


    public void onClickFriend(View view){
        System.out.println("onClickFriend");
        viewModel.updateUser();
        Picasso.get().load(viewModel.getUser().getImageUrl()).resize(200,200)
                .into(binding.imageView);
    }


}
